home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambpatchshack.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  134 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbPatchShack.cog
  4. #
  5. # Plays random ambient sounds at random positions and drops
  6. # snow at all the positions all the time.
  7. #
  8. # [TRM]
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        entered
  16.     message     pulse
  17.  
  18.     thing        soundPos0        nolink
  19.     thing        soundPos1        nolink
  20.     thing        soundPos2        nolink
  21.     thing        soundPos3        nolink
  22.     thing       singlePos       nolink
  23.     
  24.     sector      start_Amb1      linkID=1
  25.     sector      start_Amb2      linkID=1
  26.     sector      start_Amb3      linkID=1
  27.     
  28.     sector      stop_Amb1       linkID=0
  29.     sector      stop_Amb2       linkID=0
  30.     
  31.     sector      start_Single
  32.     sector      sec_Temp
  33.     
  34.     sound        ambient0=shw_amb1.wav   local
  35.     sound        ambient1=shw_amb2.wav   local
  36.     sound        ambient2=shw_amb3.wav   local
  37.     sound        ambient3=shw_amb4.wav   local
  38.     sound        ambient4=shw_amb5.wav   local
  39.     sound        ambient5=shw_amb6.wav   local
  40.     sound        ambient6=shw_amb7.wav   local
  41.     
  42.     template    tpl_Snow=skitosnow      local
  43.     template    tpl_Tim=timsnow         local       # 5m rad snow
  44.     
  45.     int         playing=0               local
  46.     int         single=0                local
  47.     int         randNum                 local
  48.     
  49.     int         randWolf                local
  50.     sound       snd_Wolf=fol_wolf_talk.wav      local
  51.     
  52. end
  53.  
  54. # ========================================================================================
  55.  
  56. code
  57.  
  58. entered:
  59.  
  60.     if((GetSenderID() == 1) && (playing == 0))
  61.     {
  62.         playing = 1;
  63.         single = 0;
  64.         setpulse(2.0);
  65.     }
  66.     
  67.     if(GetSenderID() == 0)
  68.     {
  69.         playing = 0;
  70.         SetPulse(0.0);
  71.     }
  72.     
  73.     if((GetSenderRef() == start_Single) && (playing == 0))
  74.     {
  75.         playing = 1;
  76.         single = 1;
  77.         SetPulse(2.0);
  78.     }
  79.     
  80.     if(GetSenderRef() == sec_Temp)
  81.     {
  82.         playing = 0;
  83.         single = 0;
  84.     }
  85.     
  86.     return;
  87.  
  88. # ========================================================================================
  89.  
  90. pulse:
  91.  
  92.     if(single == 0)
  93.     {
  94.         PlaySoundThing(ambient0[RandBetween(0, 6)], soundPos0[RandBetween(0, 3)], 1.0, 15, 30, 0);
  95.         
  96.         randWolf = RandBetween(1, 5);
  97.     
  98.         if(randWolf == 10)
  99.         {
  100.             PlaySoundThing(snd_Wolf, soundPos0[RandBetween(0, 7)], 0.5, 15, 30, 0);
  101.         }
  102.     
  103.         if(GetPerformanceLevel() >= 2)
  104.         {
  105.             CreateThing(tpl_Snow, soundPos0);        
  106.             CreateThing(tpl_Snow, soundPos1);        
  107.             CreateThing(tpl_Snow, soundPos2);        
  108.             CreateThing(tpl_Snow, soundPos3);
  109.         }
  110.     }
  111.     
  112.     else
  113.     {
  114.         Print("AmbPatchShack: singlePos");
  115.         
  116.         randNum = RandBetween(1, 3);
  117.         
  118.         if(randNum == 1)
  119.         {
  120.             PlaySoundThing(ambient0[RandBetween(0, 6)], singlePos, 1.0, 5, 20, 0);
  121.         }
  122.         
  123.         if(GetPerformanceLevel() >= 2)
  124.         {
  125.             CreateThing(tpl_Tim, singlePos);
  126.         }
  127.     }        
  128.     
  129.     return;
  130.  
  131. # ========================================================================================
  132.  
  133. end
  134.